]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
gdm/util: Do not handle fingerprint async errors in call
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Tue, 25 Oct 2022 02:47:08 +0000 (04:47 +0200)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Wed, 28 Feb 2024 21:10:44 +0000 (22:10 +0100)
It's better to do this at caller level so that we have more control of
what to do on errors.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2267>

js/gdm/util.js

index 36a63da762f146ea8916f47089ef234ed50686f6..6731200f66c1e0a956405369e3c2fe18d416aa38 100644 (file)
@@ -170,7 +170,7 @@ export class ShellUserVerifier extends Signals.EventEmitter {
         this._userName = userName;
         this.reauthenticating = false;
 
-        this._checkForFingerprintReader();
+        this._checkForFingerprintReader().catch(logError);
 
         // If possible, reauthenticate an already running session,
         // so any session specific credentials get updated appropriately
@@ -355,19 +355,17 @@ export class ShellUserVerifier extends Signals.EventEmitter {
             return;
         }
 
-        try {
-            const [device] = await this._fprintManager.GetDefaultDeviceAsync(
-                Gio.DBusCallFlags.NONE, this._cancellable);
-            const fprintDeviceProxy = new FprintDeviceProxy(Gio.DBus.system,
-                'net.reactivated.Fprint',
-                device);
-            const fprintDeviceType = fprintDeviceProxy['scan-type'];
-
-            this._fingerprintReaderType = fprintDeviceType === 'swipe'
-                ? FingerprintReaderType.SWIPE
-                : FingerprintReaderType.PRESS;
-            this._updateDefaultService();
-        } catch (e) {}
+        const [device] = await this._fprintManager.GetDefaultDeviceAsync(
+            Gio.DBusCallFlags.NONE, this._cancellable);
+        const fprintDeviceProxy = new FprintDeviceProxy(Gio.DBus.system,
+            'net.reactivated.Fprint',
+            device);
+        const fprintDeviceType = fprintDeviceProxy['scan-type'];
+
+        this._fingerprintReaderType = fprintDeviceType === 'swipe'
+            ? FingerprintReaderType.SWIPE
+            : FingerprintReaderType.PRESS;
+        this._updateDefaultService();
     }
 
     _onCredentialManagerAuthenticated(credentialManager, _token) {